import java.util.Scanner;

//求斐波那契数列的第n项。(迭代实现)
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入下标:");
        int n = scan.nextInt();
        int a = 1;
        int b = 1;
        int c = 0;
        for (int i = 0; i <n-1 ; i++) {
            c = a + b;
            a = b;
            b = c;
        }
        if(n == 0 || n == 1) {
            System.out.println(1);
        }else {
            System.out.println(c);
        }

    }
}
